#ifndef __FSM_H
#define __FSM_H

#include "main.h"


typedef enum {
    MENU_1,
    MENU_2,
    MENU_3,
    MENU_4,
	Close_the_system
} State;

typedef enum {
    EVENT_RIGHT,
    EVENT_LEFT,
    EVENT_UP,
    EVENT_DOWN,
	EVENT_IN
} Event;

typedef State (*StateHandler)(Event);

typedef struct 
{
    State current_state;
    StateHandler state_handlers[5];
}StateMachine;

State handle_MENU_1(Event event);
State handle_MENU_2(Event event);
State handle_MENU_3(Event event);
State handle_MENU_4(Event event);
State handle_Close_the_system(Event event);

void initialize_state_machine(StateMachine *sm);
void process_event(StateMachine *sm, Event event);

void PROCESS_the_state(State current_state);

void FSM_Init(void);


#endif
